<template>
  <van-nav-bar
    :title="$route.meta.title"
    left-text="返回"
    left-arrow
    @click-left="onClickLeft"
  />
  <!-- <div class="nav-bar">
    头部导航 {{ $route.meta.title }}
  </div> -->
</template>

<script>
export default {
  name: 'NavBar',
  methods: {
    // 点击，返回上一页
    onClickLeft() {
      // console.log(this.$router)
      this.$router.back() // 编程式的导航
    },
  },
}
</script>

<style lang="less" scoped>
  /* 样式穿透 */
  /deep/.van-nav-bar__text {
    color: #f00;
  }
  .van-nav-bar /deep/.van-icon {
    color: #f00;
  }
</style>
